
-- 判断 0 '' nil 的正负性
if 0 and '' and 1 and 100 then
	print "0 and '' and 1 and 100 ,all of them are true."
end

if not(nil or false) then
	print 'nil or false ,all of them are false.'
end


local flag = false

-- 'or'和 'and'都是可短路的（译者注：如果已足够进行条件判断则不计算后面的条件表达式）。
-- 类似于C/js里的 a?b:c 操作符：
local name = flag and 'yes' or 'no'  --> 'no'
assert('no' == name)

local flag = true
local name = flag and 'yes' or 'no'  --> 'yes'
assert('yes' == name)

local flag = true
local name = flag and 'yes' and 'haha' or 'no'  --> 'haha'
assert('haha' == name)

local name;
assert(nil == name) -- 重新声明一个变量会变为一个新的 nil 变量


local a,b=1,2
assert(a==1 and b==2) 
assert(a==1 or b==10) 
assert(a<2 and b<3) 

index = 2
if index >=1 and index <=14 then
	print('right')
end



